<template>
	<view class="content width90 marginLeft5">
		
		<view class="html" v-html="data.contentTop"></view>
		
		<view class="title">加盟留言</view>
		<textarea class="textarea" v-model="data.mess" placeholder="请输入您的加盟留言~最多300字" maxlength="300" />
		<view class="btnSure" @tap="sureBtn">提交</view>
		
		<view class="title">加盟流程</view>
		<view class="html" v-html="data.contentBottom"></view>
		
		
	</view>
</template>
<style>
	.content{width: 90%;padding-top: 20upx;}
	.content .title{font-size: 36upx;color:#262626;font-weight: bold;margin:20upx 0}
	.content .textarea{width: 90%;height:400upx;background: #F5F5F9;padding:5%;border-radius: 10upx;}
	.content .btnSure{width: 100%;margin-top: 40upx;background: #DC582A;font-weight: bold;font-size: 32upx;color:white;border-radius: 100upx;text-align: center;padding:20upx}
</style>
<script>
	import Share from '@/common/wx_share.js'
	export default {
		data() {
			return {
				share:{
					title:"",
					path:'/pages/other/join/join',
					imageUrl:'',
					desc:'',
					content:''
				},
				data:{
					contentTop:"",
					mess:"",
					contentBottom:"",
				},
			}
		},
		onLoad(){
			this.AjaxLoad()
		},
		methods: {
			AjaxLoad(){
				let param={
					token:this._$userToken("userInfo").token,
				};
				this._$InitRequest.request("join_message/index", param).then(res => {
					this.data.contentTop = res.data.a1
					this.data.contentBottom = res.data.a2
				},error=>{})
			},
			sureBtn(){
				let param={
					token:this._$userToken("userInfo").token,
					message:this.data.mess
				};
				this._$InitRequest.request("join_message/add", param).then(res => {
					uni.showToast({icon:"none",title:res.mess})
					setTimeout(function(){
						uni.switchTab({
							url:"/pages/tabbar/index"
						})
					},1500)
				},error=>{})
			},
			
			
		}
	}
</script>
<style lang="scss" scoped>
/deep/ .uni-input-input {font-size:32upx}
/deep/ .uni-radio-input-checked{background-color:rgb(110,43,34) !important;border:2upx solid white !important}
.content .html{
  ::v-deep {
    img {
      width: 100%;
    }
  }
}
</style>